﻿using Quartz;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using EmgrMvc.BLL;

namespace EmgrMvc.Models
{
    public class SayHelloJob : IJob
    {
        public string UserName { get; set; }
        public string Topic { get; set; }
        public string Data { get; set; }
        public MyContext DbContext { get; set; }
        MqttTool tool;

        public Task Execute(IJobExecutionContext context)
        {
            tool = MqttTool.getSingleton(); // new MqttTool();
            return Task.Factory.StartNew(() =>
            {
                Console.WriteLine($"Key：{context.JobDetail.Key}");
                //tool.ACControl(Topic, Data);
            });
        }
    }
}
